package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

public abstract class DocumentPropertyCollection implements Cloneable, Iterable {
   private ArrayList a = new ArrayList();

   public int getCount() {
      return this.a.size();
   }

   public DocumentProperty get(String name) {
      if (!zbom.a(name)) {
         throw new CellsException(7, "The argument cannot be null or empty string.");
      } else {
         zbom.a(name, "name");

         for(int var2 = 0; var2 < this.a.size(); ++var2) {
            DocumentProperty var3 = (DocumentProperty)this.a.get(var2);
            if (com.aspose.cells.b.a.zv.b(var3.getName().toLowerCase(), name.toLowerCase())) {
               return var3;
            }
         }

         return null;
      }
   }

   public DocumentProperty get(int index) {
      return (DocumentProperty)this.a.get(index);
   }

   public Iterator iterator() {
      return this.a.iterator();
   }

   DocumentProperty a(int var1, int var2, String var3, Object var4, boolean var5) {
      DocumentProperty var6 = new DocumentProperty(this, var1, var2, var3, var4, var5);
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var6);
      return var6;
   }

   public boolean contains(String name) {
      int var2 = this.indexOf(name);
      return var2 != -1;
   }

   public int indexOf(String name) {
      for(int var2 = 0; var2 < this.a.size(); ++var2) {
         DocumentProperty var3 = (DocumentProperty)this.a.get(var2);
         if (com.aspose.cells.b.a.zv.b(var3.getName().toLowerCase(), name.toLowerCase())) {
            return var2;
         }
      }

      return -1;
   }

   public void remove(String name) {
      zbom.a(name, "name");
      int var2 = this.indexOf(name);
      if (var2 != -1) {
         this.removeAt(var2);
      }

   }

   public void removeAt(int index) {
      DocumentProperty var2 = this.get(index);
      this.a.remove(index);

      for(int var3 = 0; var3 < this.getCount(); ++var3) {
         DocumentProperty var4 = this.get(var3);
         if (var4.c() && var4.b() == var2.a()) {
            this.a.remove(var3);
            break;
         }
      }

   }

   public void clear() {
      this.a.clear();
   }
}
